<?php

function generateTable($ids) {
				echo "<table border='1'>
					<thead>
						<td>Name</td>
						<td>Amount</td>
						<td>Duedate</td>
						<td>: )</td>
					</thead>";
				
				echo "Select paymentplan to use for this payment";
		
				
				
				foreach ($ids as $id){
					$paymentplanquery = "SELECT * FROM paymentplan WHERE id=\"".$id."\"";
					$paymentQR = mysql_query($paymentplanquery); // payment query result
					$pqr = mysql_fetch_array($paymentQR); // payment query row

					echo "<tr>";
					echo "<td>".$pqr['name']."</td>";
					echo "<td>".$pqr['amount']."</td>";
					echo "<td>".$pqr['duedate']."</td>";
					echo "<td>". "<input type=\"checkbox\" name=\""."names[".$pqr['id']."]"."\"/>"."</td>";
					echo "</tr>";
				}
				echo "</table>";
				//echo "<input type=\"submit\" value=".date("Y-m-d").">";
				//echo "<input type=submit value=Advanced>";
				include '../money/generatepayments.php';
	
	
}